package com.lin.fengxiu.repository;

import com.lin.fengxiu.model.UserCoupon;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import javax.swing.text.html.Option;
import java.util.Optional;

/**
 * @ClassName UserCouponRepository
 * @Description TODO 用户与优惠券关系
 * @Author wushaopei
 * @Date 2021/3/28 22:16
 * @Version 1.0
 */
@Repository
public interface UserCouponRepository  extends JpaRepository<UserCoupon,Long> {

    /**
     * @Description TODO 查询用户是否已经领取过优惠券
     * @param uid
     * @param couponId
     * @return
     */
    Optional<UserCoupon> findFirstByUserIdAndCouponId(Long uid, Long couponId);

}
